/*
 * Copyright 2017-8-30 13:56:25 The JA-SIG Collaborative. All rights reserved.
 * distributed with thi file and available online at
 */
package com.lap.scp.admin.core;

import java.util.List;

import com.lap.scd.commons.core.exception.ManagerException;
import com.lap.scd.commons.page.Page;
import com.lap.scp.admin.domain.RoleDO;
import com.lap.scp.admin.domain.RoleResourcesDO;
import com.lap.scp.admin.query.RoleQueryDO;

/**
 * <pre>
 * // TODO 注释
 * </pre>
 * 
 * @author 系统自动生成 Exp
 * @Date 2017-8-30 13:56:25
 * @since 1.0
 */
public interface RoleManager {
	/**
	 * 根据ID删除数据信息
	 * 
	 * @param roleId
	 * @return 改变数量
	 */
	int deleteById(int roleId) throws ManagerException;

	/**
	 * 新增
	 *
	 * @param roleDO
	 */
	void insertRole(RoleDO roleDO) throws ManagerException;

	/**
	 * 根据ID查询数据信息
	 *
	 * @param roleId
	 * @return RoleDO
	 */
	RoleDO queryById(int roleId) throws ManagerException;

	/**
	 * 分页查询数据信息
	 *
	 * @param page
	 * @param queryDO
	 * @return 数据集合
	 */
	List<RoleDO> queryPage(Page page, RoleQueryDO queryDO) throws ManagerException;

	/**
	 * 根据ID修改
	 *
	 * @param roleDO
	 * @return
	 */
	int updateRole(RoleDO roleDO) throws ManagerException;

	/**
	 * 根据角色ID查询关联的资源信息
	 * 
	 * @param roleId
	 * @return
	 * @throws ManagerException
	 */
	List<Integer> queryResourcesIdById(int roleId) throws ManagerException;

	/**
	 * 保存角色和资源的关联数据
	 * 
	 * @param roleId
	 *            角色Id
	 * @param list
	 *            资源Id
	 * @return
	 * @throws ManagerException
	 */
	int bindResources(int roleId, List<RoleResourcesDO> list) throws ManagerException;
}
